package com.test.design_pattern.singleton;

/**
 * 饿汉式
 */
public class Single02 {
    private static final Single02 INSTANCE = new Single02();

    private Single02() {
    }

    public static Single02 getInstance(){
        return INSTANCE;
    }

    public static void main(String[] args) {
        Single02 s1 = Single02.getInstance();
        Single02 s2 = Single02.getInstance();
        System.out.println(s1==s2);
    }
}